%draw grid line
%p:grid image
%h:height of grid image
%w:width of grid image
%hspotcoff:coordinate of each vertical grid line
%vspotcoff: coordinate of each horizontal grid line
%hf: number of horizontal grid lines
%vf:number of vertical grid lines
function Drawgrid(p,h,w,hspotcoff,vspotcoff,hf,vf)
%draw the horizontal grid line
figure,imshow(p);
for m=1:hf
  hold on
 plot(1:w,hspotcoff(m),'r');
end
%draw the vertical grid line
for n=1:vf
  hold on
  plot(vspotcoff(n),1:h,'r');
end

